import Vue from 'vue'
import Vuex from 'vuex'
import CityModule from '@/store/modules/CityModule'
import FilmModule from '@/store/modules/FilmModule'
import CinemaModule from '@/store/modules/CinemaModule'

// 引入 vuex 持久化工具 vuex-persistedstate
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [createPersistedState({
    paths: ['CityModule.cityId', 'CityModule.cityName'] // vuex 持久化，paths属性用来指定特定的 state
  })],
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    CityModule,
    FilmModule,
    CinemaModule
  }
})
